#ifndef _CUR_TIME_PARAM_VALUE_H_
#define _CUR_TIME_PARAM_VALUE_H_
#include "CommonParamValue.h"
#include "ReportSystemExceptions.h"
#include <ctime>
class CurTimeParamValue : public CommonParamValue
{
public:
	CurTimeParamValue(){}
	virtual void SetValue(const string& strValue){}
	virtual string GetValue() const
	{
		try
		{
			time_t t;
			time(&t);
			tm *curTime = localtime(&t);
			ostringstream out;
			out << curTime->tm_mday << '-'
				<< 1 + curTime->tm_mon << '-'
				<< 1900 + curTime->tm_year << ' '
				<< curTime->tm_hour << ':'
				<< curTime->tm_min;
			return out.str();
		}
		catch(exception& systemExcep)
		{
			string message = '\n' + "Error when running CurTimeParamValue->GetValue() method: " +
				(string)systemExcep.what() + '\n';
			ExitProgram status = NO;
			throw ReportSystemExceptions(message, status);
		}
	}
};

#endif